package dyyx;
import java.util.HashMap;
import java.util.Map;

import cn.hutool.json.JSONUtil;

public class JsonUtilTest {

	public static void main(String[] args) throws Exception {
		Map<String,Integer> map = new HashMap<>();
		map.put("a", 1);
		map.put("b", 2);
		String str = JSONUtil.toJsonStr(map);
		System.out.println(str);
		
		Map map2 = JSONUtil.parseObj(str).toBean(Map.class);
		
		System.out.println(map2);

		str = JSONUtil.toJsonPrettyStr(map);
		System.out.println(str);
		
	}
}
